home *** CD-ROM | disk | FTP | other *** search
- Path: taco.cc.ncsu.edu!jkhammon
- From: jkhammon@unity.ncsu.edu (John Kirk Hammond)
- Newsgroups: comp.lang.c++
- Subject: How does the c++ compiler handle references?
- Date: 29 Feb 1996 07:42:25 GMT
- Organization: North Carolina State University
- Sender: jkhammon@eos.ncsu.edu
- Message-ID: <4h3ld1$jd1@taco.cc.ncsu.edu>
- NNTP-Posting-Host: c00964-100lez.eos.ncsu.edu
-
- Just kinda curious...
-
- How does the c++ handle functions whose parameters are
- passed by reference?
-
- i.e.
-
- void test(short &hello)
- {
- hello++;
- }
-
- void foo ()
- {
- short hello = 0;
- test(hello);
- }
-
- Does the compiler do some sort of funky pointer weirdness?
- Like sending the address of hello instead of the value to test and
- casting the short parameter in test to a short *? And then
- treating all uses of the variable hello in test as the dereferenced
- pointer?
-
- -kirk
-
-
-